This section has details for more advanced users.
If a copy of clamwin.conf is in the ClamWin executable files directory ("C:\Program Files\ClamWin\bin" on a default installation), then the first time a user runs ClamWin, it will use the contents of this file as the default configuration.
If you are to set up several new user accounts on a computer, or if you have just installed ClamWin on a system with multiple users, it is recommended that you set up a default configuration and copy the clamwin.conf file to this location.
ClamWin can be run from the command line, from a batch file for instance. For a full list of parameters, navigate to the directory containing the executable files ("C:\Program Files\ClamWin\bin" on a default installation) and run
clamscan.exe
--help
The
database directory must be
specified, using the
--database=FILE/DIR
parameter. In a default installation, the command to scan the entire
C:
drive would be:
clamscan.exe
--database="C:\Program Files\ClamWin\db" --recursive C:\
Note
the use of the
--recursive
parameter to ensure that sub-directories are scanned.
When
run from the command line, a value will be returned, indicating
whether or not a virus was detected. If no virus is found, the return
value will be 0. If a virus is found, the return value is 1. Any
other return value indicates an error.
Updating
the Virus Database from the Command Line
ClamWin uses freshclam.exe
to update the virus database. As with the clamscan.exe
scanning program, this can be run from a command line, batch file,
etc. For a full list of parameters, navigate to the directory
containing the executable files ("C:\Program Files\ClamWin\bin"
on a default installation) and run
freshclam.exe
--help
Both
the database directory and the configuration file must
be specified. ClamWin generates a freshclam configuration file on the
fly, so you will have to create your own. The configuration file is a
text file. See the ClamAV
documentation
for full details of what can be included. A simple freshclam
configuration file would have the following lines (lines beginning
with a # are comments):
#
URL of server where database updates are to be downloaded from
#
If this option is given multiple times, each will be tried in
#
the order given until an update is successfully downloaded
DatabaseMirror
database.clamav.net
#
Number of times to try each mirror before moving to the next one
MaxAttempts
3
Once
a freshclam configuration file has been created, freshclam can be run
with a command similar to the one below:
freshclam
--datadir="C:\Documents and Settings\All Users\.clamwin\db"
--config-file="C:\Program Files\ClamWin\bin\freshclam.conf"
Getting
Updates from a Local Server
If
you have ClamWin running on several networked computers, you may wish
to have a single computer downloading updates from the Internet, with
the others getting updates over the local network. This can be done
in one of three ways.
The
first (and preferred) method requires a web server. This web server
should have the main.cvd and daily.cvd files in the web root
directory. It should be possible to download the files by pointing a
web browser at
http://YOURSERVERNAME/main.cvd
and http://YOURSERVERNAME/daily.cvd
In
ClamWin's Internet Updates configuration tab, enter the web
server's IP address or domain name in the Download Site
text box. Do not include anything other than the IP address or domain
name (eg
192.168.1.1
is correct, http://192.168.1.1/
is wrong). ClamWin will then query the local web server for updates,
instead of a remote Internet server.
The
second method is to set up a batch file or similar to copy the
main.cvd and daily.cvd files from the server to the relevant location
on the clients, over-writing the existing copies. Windows' Task
Scheduler can be used to run this batch file as often as required.
Disable ClamWin's Enable Automatic Virus Database Updates
option, so that it does not query the remote Internet server for
updates.
The
third method is to set the Virus Database Folder in all copies of
ClamWin to a shared folder (eg
\\SERVER-NAME\SHARED-DRIVE\db
).
Note that, in this case, only one copy of ClamWin (preferably the
copy on the server) should be set up to get automatic updates.
Manually
Updating the Virus Database
To
update the virus database manually, download the virus database files
main.cvd
and daily.cvd
and
copy them to ClamWin's virus database folder, over-writing the
existing files. The virus database files can be downloaded from
ClamAV's home page at www.clamav.net